package com.example.zhinongbao.presenter;


import com.example.zhinongbao.Model.IShoppingCart;
import com.example.zhinongbao.entity.Cart;
import com.example.zhinongbao.entity.Goods;

import java.util.List;

public class ShoppingCartPresenter {
    private IShoppingCart iShoppingCart ;
    public ShoppingCartPresenter(IShoppingCart iShoppingCart){
        this.iShoppingCart = iShoppingCart ;
    }

    public List<Cart> getCartByPhone() {
        return iShoppingCart.getCartByPhone();
    }

    public void deleteCartById(int id) {
        iShoppingCart.deleteCartById(id);
    }

    public Cart getCartById(int id) {
        return iShoppingCart.getCartById(id);
    }

    public void updateCartNumById(int id, int num) {
        iShoppingCart.updateCartNumById(id, num);
    }

    public Goods getGoodsById(int id) {
        return iShoppingCart.getGoodsById(id);
    }


//    public int getLocalDefaultId() {
//        return iShoppingCart.getLocalDefaultId();
//    }
//    public void addOrUpdateFoot(int goodsId, String user, String time) {
//        iShoppingCart.addOrUpdateFoot(goodsId,user,time);
//    }
}
